﻿
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
    <thead>
        <tr>
            <th width="8%">Số thứ tự</th>
            <th>Tên đăng nhập</th>
            <th>Họ tên</th>
            <th>Ngày sinh</th>
            <th>Địa chỉ</th>
            <th>Email</th>
            <th>Số điện thoại</th>
            <th>Số sản phẩm</th>
            <th>Số bình luận</th>
            <th>Thao tác</th>
        </tr>
    </thead>
    <tbody>
        <?php
            for($i=0; $i<count($taikhoan); $i++){
                echo"<tr class='gradeU'>";
                    echo"<td align='center'>".($i+1)."</td>";
                    echo"<td>".$taikhoan[$i]['TenDangNhap']."</td>";
                    echo"<td><b>".$taikhoan[$i]['HoTen']."</b></td>";
                    echo"<td align='center'>".$taikhoan[$i]['NgaySinh']."</p></td>";
                    echo"<td>".$taikhoan[$i]['DiaChi']."</td>";
                    echo"<td>".$taikhoan[$i]['Email']."</td>";
                    echo"<td>".$taikhoan[$i]['SoDienThoai']."</td>";
                    echo"<td class='center' width='100'><a href='#'>".$sosp[$i]."</a></td>";
					echo"<td class='center' width='100'><a href='#'>".$sobl[$i]."</a></td>";
                    echo"<td class='center'><a title='Xóa tài khoản' onclick='return show_confirm();'><img lang='".$taikhoan[$i]['MaTaiKhoan']."' class='delBtn' src='".base_url()."images/trash.png' height='32' width='32' ></a></td>";
                echo"</tr>";
            }
        ?>
    </tbody>
</table>
<script type="text/javascript" src="<?=base_url()?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?=base_url()?>js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('#example').dataTable( {
			"aaSorting":[[0,'asc']],
			"bJQueryUI": true,
			"sPaginationType": "full_numbers",
			"aoColumns": [{"bSearchable": false},
						  {"bSearchable": false, "bSortable": false},
			              null,
						  {"bSortable": false},
						  {"bSortable": false},
						  {"bSortable": false},
			              {"bSearchable": false},
			              null,
						  null,
			              {"bSearchable": false, "bSortable": false}]
		});
		
		$('.editBtn').hover(function(){
			$(this).attr('src','<?=base_url()?>images/edit_hover.png');
		}, function(){
			$(this).attr('src','<?=base_url()?>images/edit.png');
		});
		$('.delBtn').hover(function(){
			$(this).attr('src','<?=base_url()?>images/trash_hover.png');
		}, function(){
			$(this).attr('src','<?=base_url()?>images/trash.png');
		});

		$('.delBtn').click(function(){
			var matk = ($(this).attr('lang'));
			//alert(masp);
			var conf = confirm("Bạn muốn xóa tài khoản?");
			if(conf == true){
				//alert(matk);
				$.post("<?=base_url()?>index.php/qltk_admin_controller/xoataikhoan",{matk:matk},function(data){
					//alert(matk);
					$('#noi_dung').html(data);
					//alert(masp);
					});
			}else{
				return false;
			}
		});
	})
</script>